﻿namespace WMS6.Services
{
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.ServiceModel;
    using System.ServiceModel.Activation;
    using WMS6.BLL;
    using WMS6.Common;
    using WMS6.DataEntity;
    using WMS6.QueryEntity;

    [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall), AspNetCompatibilityRequirements(RequirementsMode=AspNetCompatibilityRequirementsMode.Allowed)]
    public class CustomizeReportService : ICustomizeReportService
    {
        public DataSet GetLPSaleReport(LPSaleReportQueryEntity lPSaleReportQueryEntity, PubParasInfo pubParasInfo)
        {
            try
            {
                CustomizeReportBLL customizeReportBLL = new CustomizeReportBLL(pubParasInfo);
                return customizeReportBLL.GetLPSaleReport(lPSaleReportQueryEntity);
            }
            catch (Exception ex)
            {
                CommonErrorHandler.ErrorTypeExchange(ex, "CustomizeReportServices异常");
            }
            return null;
        }

        public DataSet GetNSNPerformanceReportByDataSet(NSNPerformanceReportQueryEntity nsnPerformanceReportQueryEntity, PubParasInfo pubParasInfo)
        {
            try
            {
                CustomizeReportBLL customizeReportBLL = new CustomizeReportBLL(pubParasInfo);
                return customizeReportBLL.GetNSNPerformanceReportByDataSet(nsnPerformanceReportQueryEntity);
            }
            catch (Exception ex)
            {
                CommonErrorHandler.ErrorTypeExchange(ex, "CustomizeReportServices异常");
            }
            return null;
        }

        public DataSet GetTNTDailyInventoryRptDataSet(InventoryQueryEntity inventoryQueryEntity, PubParasInfo pubParasInfo)
        {
            try
            {
                CustomizeReportBLL customizeReportBLL = new CustomizeReportBLL(pubParasInfo);
                return customizeReportBLL.GetTNTDailyInventoryRptDataSet(inventoryQueryEntity);
            }
            catch (Exception ex)
            {
                CommonErrorHandler.ErrorTypeExchange(ex, "CustomizeReportServices异常");
            }
            return null;
        }

        public DataSet GetTNTInOutStockInvRptDataSet(TNTInOutStockInvRptQueryEntity tntInOutStockInvRptQueryEntity, PubParasInfo pubParasInfo)
        {
            try
            {
                CustomizeReportBLL customizeReportBLL = new CustomizeReportBLL(pubParasInfo);
                return customizeReportBLL.GetTNTInOutStockInvRptDataSet(tntInOutStockInvRptQueryEntity);
            }
            catch (Exception ex)
            {
                CommonErrorHandler.ErrorTypeExchange(ex, "CustomizeReportServices异常");
            }
            return null;
        }

        public DataSet GetYITAISerialNoInOutReport(YITAISerialNoInOutReportQueryEntity serialNoInOutReportQueryEntity, PubParasInfo pubParasInfo)
        {
            try
            {
                CustomizeReportBLL customizeReportBLL = new CustomizeReportBLL(pubParasInfo);
                return customizeReportBLL.GetYITAISerialNoInOutReport(serialNoInOutReportQueryEntity);
            }
            catch (Exception ex)
            {
                CommonErrorHandler.ErrorTypeExchange(ex, "CustomizeReportServices异常");
            }
            return null;
        }

        public string UpdateYITAISerialNoInOutReportFlag(List<string> transIDs, List<string> otTransIDs, PubParasInfo pubParasInfo)
        {
            try
            {
                CustomizeReportBLL customizeReportBLL = new CustomizeReportBLL(pubParasInfo);
                return customizeReportBLL.UpdateYITAISerialNoInOutReportFlag(transIDs, otTransIDs);
            }
            catch (Exception ex)
            {
                CommonErrorHandler.ErrorTypeExchange(ex, "CustomizeReportServices异常");
            }
            return "";
        }
    }
}

